package com.example.hessian.config;

import com.example.hessian.services.SayHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.caucho.HessianServiceExporter;

/**
 * @author Mr.yuan
 * @version v1.0
 * @date 2019/12/31 17:24
 **/
@Configuration
public class HessianConfig {

    @Autowired
    private SayHelloService sayHelloService;


    @Bean("/hello")
    public HessianServiceExporter register() {
        HessianServiceExporter exporter = new HessianServiceExporter();
        exporter.setService(sayHelloService);
        exporter.setServiceInterface(SayHelloService.class);
        return exporter;
    }
}
